package com.ycMc.mapper;

import com.ycMc.domain.Order;
import com.ycMc.domain.OrderDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * Created by libo2 on 2017/9/23.
 */
@Repository
public interface OrderDetailMapper {

    public void insert(OrderDetail orderDetail);
    public void delete(@Param("orderDetailId")String orderDetailId);
    public void update(OrderDetail orderDetail);
    public List<OrderDetail> select(@Param("orderDetailId")String  orderDetailId,
                              @Param("productId")String  productId,
                              @Param("productBrand")String  productBrand,
                              @Param("productName")String  productName,
                              @Param("productVersion")String  productVersion,
                              @Param("userId")String  userId,
                              @Param("orderId")String orderId,
                              @Param("offset")int offset,@Param("pageSize")int pageSize);
    public OrderDetail selectOne(@Param("orderDetailId")String orderDetailId);

    public List<OrderDetail> query(@Param("keyword")String  keyword,@Param("offset")int offset,@Param("pageSize")int pageSize);

    public List<OrderDetail> getOrderDetailByOrderId(@Param("orderId")String orderId,
                                                                                   @Param("offset")int offset,@Param("pageSize")int pageSize);

    public List<HashMap> getChartByProductBrand(@Param("userId")String userId);

    public List<HashMap> getChartByProductName(@Param("userId")String userId);

    public void updateOrderStateByOrderId(@Param("orderState")int orderState,@Param("orderId")String orderId);
}
